function OList(t,i,e,s){0===e.length&&(e={}),s=s||{},this.indexer=new vkIndexer(i,s.getName?s.getName:function(t){return t[1]}),this.owners=i,this.tpl=s.tpl,this.rsTpl=s.rsTpl,this.idIndex=s.idIndex||0,this.selected=e,this.getUnsorted=s.getUnsorted,this.unsortedIndex=s.unsortedIndex||0,this.box=t,this.filter=s.filter,s.onTabUpdate&&(this.onTabUpdate=s.onTabUpdate),s.onListClick&&(this.onListClick=s.onListClick),t.setButtons(getLang("global_save"),function(e){var n={},r=[],l=[];each(i,function(){!o.invertedSelection&&o.selected[this[o.idIndex]]||o.invertedSelection&&!o.selected[this[o.idIndex]]?(n[this[o.idIndex]]=this,r.push(this[o.idIndex])):l.push(this[o.idIndex])}),cur.onOListSave(r,l,n,s.ret||{},e)!==!1&&t.hide(200)},getLang("global_cancel")),s.box_options&&t.setOptions(s.box_options);var o=this;this.scrollNode=geByClass1("privacy_olist",t.bodyNode),this.moreEl=geByClass1("olist_more",t.bodyNode,"a"),this.olistEl=geByClass1("olist",t.bodyNode,"div"),this.olistFilter=ge("olist_filter_actions"),this.sel=s.sel||0,this.tabs=geByClass1("ui_tabs",t.bodyNode),this.noSelMsg=s.noSelMsg||getLang("friends_no_user_selected"),this.invertedSelection=!1;var n=geByClass1("olist_tab_sel",this.tabs);this.selCnt=intval(val(geByClass1("ui_tab_count",n)));var r=this.filter?this.filter:this.filter=ge("olist_filter");setTimeout(elfocus.pbind(r),100),this.moreEl&&(isVisible(this.moreEl)?this.moreEl.onclick=function(t){return o.renderList("",60),cancelEvent(t)}:(re(this.moreEl),show(this.moreEl))),addEvent(this.olistEl,"click",this.onMouseEvent.bind(this)),addEvent(this.scrollNode,"scroll",this.onScroll.bind(this));var l=o.sel?o.sel>0?"sel":"unsel":"all",a=geByClass1("olist_tab_"+l,o.tabs);a=a&&geByClass1("ui_tab",a),(cur.onOListTabChange=function(t,i){t&&uiTabs.switchTab(t),void 0===i&&(i=void 0===o.selPrev?0:o.selPrev),o.selPrev=o.sel,o.sel=i,o.renderList(val(r),0,i),setTimeout(elfocus.pbind(r),100)})(a,o.sel),cur.onOlistChange=o.renderList.bind(this),cur.onOlistSelect=o.onOlistSelect.bind(this),cur.onOlistFilters=o.onOlistFilters.bind(this)}function Slider(t,i){if(this.constructor!=Slider)throw new Error("Slider was called without 'new' operator");if(!t)throw new Error("No element was provided for Slider");t=ge(t),this.options=i||{size:1},this.options.backValue=this.options.backValue||0;var e=100*this.options.backValue,s=this.options.withBackLine?'
':"",o='';this._el=ce("div",{innerHTML:o,className:"slider",id:t.getAttribute("id")||""});for(var n=t.classList,r=this,l=0,a=n.length;a>l;l++)addClass(this._el,n[l]);each(this._el.attributes,function(t,i){("id"!=i.name||"class"!=i.name)&&r._el.setAttribute(i.name,i.value)}),t.parentNode.replaceChild(this._el,t),data(this._el,"slider",this),this._amountEl=geByClass1("slider_amount",this._el),this._handlerEl=geByClass1("slider_handler",this._el),this._slideEl=geByClass1("slider_slide",this._el),this._backEl=geByClass1("slider_back",this._el),this._progressEl=geByClass1("slider_loading_bar",this._el),this.options.color&&(setStyle(this._amountEl,{backgroundColor:this.options.color}),setStyle(this._handlerEl,{backgroundColor:this.options.color})),this.options.backColor&&setStyle(this._slideEl,{backgroundColor:this.options.backColor}),addClass(this._el,"slider_size_"+this.options.size),this.options.debounce&&(this._onValueChangeDebounced=debounce(this._onValueChange,this.options.debounce)),i.formatHint&&(addEvent(this._el,"mousemove",this._ev_onMouseOver=this._onMouseOver.bind(this)),addEvent(this._el,"mouseleave",this._ev_onMouseLeave=this._onMouseLeave.bind(this))),addEvent(this._el,"mousedown",this._ev_onMouseDown=this._onMouseDown.bind(this)),this.setValue(this.options.value||0,this.options.fireChangeEventOnInit?!1:!0,!1),this.setBackValue(this.options.backValue)}var uiTabs={initTabs:function(t,i){if(!(browser.msie&&intval(browser.version)<10||browser.opera&&intval(browser.version)<15||hasClass(t,"ui_tabs_sliding"))){var e=getSize(i)[0],s=i.offsetLeft,o=geByClass1("_ui_tabs_slider",t);if(!domData(t,"inited")){var n={width:e+"px",marginLeft:s};setStyle(o,n)}}},tryInit:function(t){if(!domData(t,"inited")){var i=geByClass1("ui_tab_group_sel",t)||geByClass1("ui_tab_sel",t);i&&uiTabs.initTabs(t,i),domData(t,"inited",1)}},goTab:function(t,i,e){if(checkEvent(i))return!0;var s=gpeByClass("ui_tabs",t);return e||geByClass1("ui_tab_sel",s)!=t?(uiTabs.switchTab(t),uiTabs.showProgress(s),nav.go(t,i)):!1},switchTab:function(t,i){var e=gpeByClass("ui_tabs",t),s=geByClass1("ui_tab_sel",e),o=null,n=null,r=hasClass(s,"ui_tab_group_item")?n=gpeByClass("ui_tab_group",s):s,l=hasClass(t,"ui_tab_group_item")?o=gpeByClass("ui_tab_group",t):t;if(t!=s){if(t!=l&&(uiTabs.toggleGroup(l,!1),uiTabs.resetLabel(l,t)),r){uiTabs.initTabs(e,r),i=i||{},i.noAnim||l===r||(addClass(e,"ui_tabs_sliding"),clearTimeout(cur.tabSlidingTO),cur.tabSlidingTO=setTimeout(removeClass.pbind(e,"ui_tabs_sliding"),300));var a=geByClass1("_ui_tabs_slider",e),h=intval(a.style.marginLeft),d={width:getSize(l)[0]+"px"};d[cssTransformProp]="translateX("+(l.offsetLeft-h)+"px)",setStyle(a,d),s!=r&&l!=r&&uiTabs.resetLabel(r),r!=s&&removeClass(r,"ui_tab_group_sel"),removeClass(s,"ui_tab_sel")}if(l!=t&&addClass(l,"ui_tab_group_sel"),addClass(t,"ui_tab_sel"),n&&removeClass(n,"ui_tab_hide_separator"),o){e=geByClass1("ui_tab_group_items",o,"div").children;var c=null;each(e,function(t,i){"SPAN"===i.tagName?c=i:hasClass(domFC(i),"ui_tab_sel")||(c=null)}),c&&addClass(o,"ui_tab_hide_separator")}}return!1},resetLabel:function(t,i){var e=geByClass1("ui_tab_group_label",t,"span");e&&(e.innerHTML=(i||e).getAttribute("data-default-label"))},toggleGroup:function(t,i){var e=data(t,"visibletimer");e&&clearTimeout(e),data(t,"visibletimer",setTimeout(toggleClass.pbind(t,"visible",i),i?0:100)),toggleClass(t,"shown",i)},showGroup:function(t){var i=data(t,"hidetimer");i&&(clearTimeout(i),data(t,"hidetimer",0)),uiTabs.toggleGroup(t,!0)},hideGroup:function(t){var i=data(t,"hidetimer");i||data(t,"hidetimer",setTimeout(function(){uiTabs.toggleGroup(t,!1),data(t,"hidetimer",0)},200))},showProgress:function(t){hasClass(t,"ui_tabs")||(t=gpeByClass("ui_tabs",t)),addClass(t,"ui_tabs_loading")},hideProgress:function(t){hasClass(t,"ui_tabs")||(t=gpeByClass("ui_tabs",t)),removeClass(t,"ui_tabs_loading")},showSearch:function(t,i){if(checkEvent(i))return!0;var e=gpeByClass("ui_tabs",t),s=(domByClass(e,"ui_search"),domByClass(e,"_field"));return addClass(e,"ui_tabs_search_opened"),uiSearch.focus(s),!1},hideSearch:function(t,i){if(checkEvent(i))return!0;var e=gpeByClass("ui_tabs",t);return removeClass(e,"ui_tabs_search_opened"),!1}},uiActionsMenu={keyToggle:function(t,i){if(!checkKeyboardEvent(i))return!1;var e=domClosest("_ui_menu_wrap",t);e&&uiActionsMenu.toggle(e,!hasClass(e,"shown"))},toggle:function(t,i){var e=data(t,"dummyMenu");e&&(t=e),toggleClass(t,"shown",i)},show:function(t,i,e){var s=data(t,"hidetimer");s&&(clearTimeout(s),data(t,"hidetimer",0));var o=data(t,"origMenu");if(o&&(s=data(o,"hidetimer"))&&(clearTimeout(s),data(t,"hidetimer",0)),e&&e.appendParentCls){var n=geByClass1("_ui_menu",t),r=domClosest("_ui_menu_wrap",t);if(n){var l=domClosest(e.appendParentCls,n),a=getXY(l),h=getXY(r),d=se('');d.appendChild(n),l.appendChild(d),data(t,"dummyMenu",d),data(d,"origMenu",t),t=d;var c=intval(getStyle(n,"top")),u=intval(getStyle(n,"left")),p=intval(getStyle(n,"right")),g={top:h[1]-a[1]+c};if(p?g.right=getSize(l)[0]+a[0]-h[0]-getSize(r)[0]+p:g.left=h[0]-a[0]+u,setStyle(n,g),e.processHoverCls){var m=domClosest(e.processHoverCls,r);addEvent(t,"mouseover",addClass.pbind(m,"hover")),addEvent(t,"mouseout",removeClass.pbind(m,"hover"))}}}if(e&&e.autopos){var n=geByClass1("_ui_menu",t);if(n&&!hasClass(t,"shown")){removeClass(t,"ui_actions_menu_left");var v=getXY(t)[1],_=getSize(t)[1],f=getSize(n)[1],b=e.dy||10,w=getXY(n)[0];removeClass(t,"ui_actions_menu_top"),addClass(t,"no_transition"),v+_+b+f>(browser.mozilla?getSize("page_wrap")[1]:scrollGetY()+(window.lastWindowHeight||0))&&addClass(t,"ui_actions_menu_top"),v-b-fw),removeClass(t,"no_transition")}}uiActionsMenu.toggle(t,!0)},hide:function(t,i){var e=data(t,"hidetimer");e||data(t,"hidetimer",setTimeout(function(){uiActionsMenu.toggle(t,!1),data(t,"hidetimer",0)},200))}},uiRightMenu={initMenu:function(t,i){if(!(browser.msie&&intval(browser.version)<10||browser.opera&&intval(browser.version)<15||hasClass(t,"ui_rmenu_sliding"))){var e=geByClass1("ui_rmenu_item",t),s=geByClass1("ui_rmenu_item_sel",t),o=s||e,n=getSize(o)[1],r=o.offsetTop,l=geByClass1("_ui_rmenu_slider",t);if(!i){var a={height:n,top:s?r:0};setStyle(l,a),addClass(t,"ui_rmenu_sliding")}}},go:function(t,i,e,s){if(checkEvent(i))return!0;var o=gpeByClass("ui_rmenu",t);return(s||{}).ignoreSelected||geByClass1("ui_rmenu_item_sel",o)!=t?(uiRightMenu.switchMenu(t),uiRightMenu.showProgress(t),e===!1?!1:nav.go(e||t,i,extend({fromMenu:!0},s||{}))):!1},switchMenu:function(t,i){var e=gpeByClass("ui_rmenu",t),s=geByClass1("ui_rmenu_item_sel",e);if(t==s&&!i)return!1;var o=hasClass(t,"_audio_album_item");uiRightMenu.initMenu(e,o);var n=getSize(t)[1],r=t.offsetTop,l=[],a=[],h=domPN(t);if(o&&(r+=getXY(h)[1]-getXY(e)[1]),hasClass(e,"_ui_rmenu_auto_expand")){var d=geByClass("_ui_rmenu_sublist",e),c=hasClass(t,"_ui_rmenu_subitem")?gpeByClass("_ui_rmenu_sublist",t):hasClass(domNS(t),"_ui_rmenu_sublist")?domNS(t):!1;each(d,function(){isVisible(this)&&this!==c&&(l.push(this),hide(this))}),c&&!isVisible(c)&&(a.push(c),show(c)),r=t.offsetTop,each(l,function(){show(this)}),each(a,function(){hide(this)})}var u=geByClass1("_ui_rmenu_slider",e),p=intval(u.style.top),g={height:n};return browser.msie_edge?g.marginTop=r-p+"px":g[cssTransformProp]="translateY("+(r-p)+"px)",setStyle(u,g),removeClass(s,"ui_rmenu_item_sel"),addClass(t,"ui_rmenu_item_sel"),hasClass(e,"_ui_rmenu_auto_expand")?each(l.concat(a),function(){uiRightMenu.toggleSubmenu(this)}):hasClass(t,"_ui_rmenu_subitem")&&!isVisible(domPN(t))&&uiRightMenu.toggleSubmenu(domPN(t)),!1},unselectAll:function(t){removeClass(t,"ui_rmenu_sliding"),removeClass(geByClass1("ui_rmenu_item_sel",t),"ui_rmenu_item_sel")},hideSliding:function(t){removeClass(t,"ui_rmenu_sliding")},showSliding:function(t){addClass(t,"ui_rmenu_sliding")},showProgress:function(t){hasClass(t,"ui_rmenu")||(t=gpeByClass("ui_rmenu",t));var i=geByClass1("ui_rmenu_loading_item",t);i&&removeClass(i,"ui_rmenu_loading_item");var e=geByClass1("ui_rmenu_item_sel",t);hideProgress(t),showProgress(domFC(e),"","",!0),addClass(t,"ui_rmenu_loading"),addClass(e,"ui_rmenu_loading_item")},hideProgress:function(t){hasClass(t,"ui_rmenu")||(t=gpeByClass("ui_rmenu",t)),hideProgress(t);var i=gpeByClass("ui_rmenu",t);removeClass(t,"ui_rmenu_loading"),uiRightMenu.hideSliding(i);var e=geByClass1("ui_rmenu_loading_item",i);e&&removeClass(e,"ui_rmenu_loading_item")},toggleSubmenu:function(name,ref){var menu=gpeByClass("ui_rmenu",ref),el,submenu;if("string"==typeof name?submenu=geByClass1("_ui_rmenu_"+name+"_list",menu):(submenu=name,name=submenu.getAttribute("data-sublist-id")),el=geByClass1("_ui_rmenu_"+name+"_toggle",menu),!submenu)return!1;void 0!==ref&&uiRightMenu.hideSliding(menu),el&&toggleClass(el,"ui_rmenu_item_expanded",!isVisible(submenu)),slideToggle(submenu,submenu&&getSize(submenu)[1]?100:0),setTimeout(updateNarrow,100);var onToggle=domData(el,"on-toggle");return onToggle&&setTimeout(function(){eval(onToggle)},150),!1}},uiPageBlock={showSaved:function(t){var i=ge(t),e=i&&gpeByClass("page_block",i),s=e&&geByClass1("page_block_saved",e);if(i&&e&&s){var o=animate.pbind(s,{opacity:1},200,animate.pbind(s,{opacity:0},2e3));uiPageBlock.scrollToStart(e,o)}},scrollToStart:function(t,i){var e=getXY(t)[1],s=60,o=200;scrollGetY()>e-s?(scrollToY(e-s,o),i&&setTimeout(i,o)):i&&i()}},uiSearch={destroy:function(t){var i=uiSearch.getFieldEl(t);uiSearch.stopEvents(i),data(i,"opts",{}),data(i,"inited",0),data(i,"eventHandlers",{})},getWrapEl:function(t){return domClosest("_wrap",t)},getFieldEl:function(t){return t=ge(t),hasClass("_field",t)?t:domByClass(uiSearch.getWrapEl(t),"_field")},stopEvents:function(t){var i=data(t,"eventHandlers")||[];each(i,function(t,i){i.stop()})},startEvents:function(t){var i=data(t,"eventHandlers")||[];each(i,function(t,i){i.stop(),i.start()})},init:function(el,options){if(el&&(el=uiSearch.getFieldEl(el))){var wrapEl=uiSearch.getWrapEl(el),delayedInitOptions=!options&&domData(wrapEl,"init-options");if(delayedInitOptions)return domData(wrapEl,"init-options",null),void uiSearch.init(el,eval("(function() { return "+delayedInitOptions+" })()"));if(!data(el,"inited")){data(el,"inited",1);var onKeyDown=uiSearch.onKeyDown.pbind(el),onBuffer=function(t){setTimeout(uiSearch.onChanged.pbind(el,!1,t),0)},onBlur=uiSearch.onBlurred.pbind(el);placeholderInit(el),data(el,"opts",options);var mainHandler={start:function(){addEvent(el,"keydown",onKeyDown),addEvent(el,"paste cut input",onBuffer),addEvent(el,"blur",onBlur),options.onBlur&&addEvent(el,"blur",options.onBlur),options.onFocus&&addEvent(el,"focus",options.onFocus)},stop:function(){removeEvent(el,"keydown",onKeyDown),removeEvent(el,"paste cut input",onBuffer),removeEvent(el,"blur",onBlur),options.onBlur&&removeEvent(el,"blur",options.onBlur),options.onFocus&&removeEvent(el,"focus",options.onFocus)}};if(mainHandler.start(),data(el,"eventHandlers",[mainHandler]),options.onBlur&&addEvent(el,"blur",options.onBlur),options.onFocus&&addEvent(el,"focus",options.onFocus),options.fixed){var scrollNode=isAncestor(el,boxLayerWrap)?boxLayerWrap:window,onSearchScroll=uiSearch.scrollResize.pbind(el),eventHandler={stop:removeEvent.pbind(scrollNode,"scroll",onSearchScroll),start:addEvent.pbind(scrollNode,"scroll",onSearchScroll)};data(el,"eventHandlers",(data(el,"eventHandlers")||[]).concat([eventHandler])),eventHandler.start()}options.noAutoDestroy||cur.destroy.push(uiSearch.stopEvents.pbind(el)),uiSearch.initFilters(el,options)}}},onKeyDown:function(t,i){if(cur.preventInputActions&&-1!=[KEY.RETURN,KEY.ESC,KEY.DOWN,KEY.UP].indexOf(i.keyCode))return cancelEvent(i);if(i.keyCode==KEY.RETURN){t=uiSearch.getFieldEl(t);var e=data(t,"opts"),s=t.getValue();return e.onEnter&&e.onEnter(t,s,i),cancelEvent(i)}if(i.keyCode==KEY.ESC){var o=!!val(t);return uiSearch.reset(t,!1,i),o?cancelEvent(i):!0}setTimeout.pbind(uiSearch.onChanged.pbind(t,!1,i),0)},onBlurred:function(t,i){var e=data(t,"opts");e.onBlur&&e.onBlur.call(t,i)},onChanged:function(t,i,e){t=uiSearch.getFieldEl(t);var s=data(t,"opts"),o=uiSearch.getWrapEl(t),n=t.getValue();toggleClass(o,"ui_search_field_empty",!trim(n)),i||s.onChange&&s.onChange.call(t,n,e)},focus:function(t){t=uiSearch.getFieldEl(t),elfocus(t)},reset:function(t,i,e){t=uiSearch.getFieldEl(t);var s=data(t,"opts"),o=uiSearch.getWrapEl(t),n=t.getValue();n?(t.setValue(""),uiSearch.onChanged(t,i,e),i||s.onEnter&&s.onEnter(t,""),elfocus(t)):s.in_tabs&&uiTabs.hideSearch(o)},showProgress:function(t){t=uiSearch.getFieldEl(t);var i=uiSearch.getWrapEl(t);addClass(i,"ui_search_loading")},hideProgress:function(t){t=uiSearch.getFieldEl(t);var i=uiSearch.getWrapEl(t);removeClass(i,"ui_search_loading")},scrollResize:function(t){if(!browser.mobile){t=uiSearch.getFieldEl(t);var i,e=uiSearch.getWrapEl(t),s=e&&domPN(e),o=e&&hasClass(e,"ui_search_fixed"),n=ge(cur.uiSearchPageBlock)||gpeByClass("page_block",t),r=vk.staticheader?Math.max(0,getSize(ge("page_header"))[1]-scrollNode.scrollTop):getSize(ge("page_header"))[1],l=e&&isAncestor(e,boxLayerWrap);if(e&&s&&(l||gpeByClass("scroll_fix",e))&&(!t.ignoreFixed||o)&&isVisible(s)){var a=l?getXY(s,!0)[1]<0:getXY(s,!0)[1]'+clean(i)+'
';r!==!1?s.splice(r,0,h):e!==!1?s.splice(e,0,h):s.push(h),n++}),e.innerHTML=s.join("")}}},uiScrollBox={init:function(t,i){cur.lSTL&&re(cur.lSTL),i=i||{};var e=i.parent=i.parent||boxLayerWrap;extend(cur,{lSTLWrap:e,lSTL:e.appendChild(ce("div",{id:"layer_stl",innerHTML:''+getLang("global_to_top")+"",el:t.bodyNode,onclick:cancelEvent,onmousedown:uiScrollBox.lSTLDown,sc:uiScrollBox.onScroll})),lSTLText:ge("layer_stl_text",e),lSTLShown:0,lSTLWas:0,lSTLWasSet:0,lSTLOpts:i}),t&&t.setOptions({onShow:uiScrollBox.show,onHide:uiScrollBox.hide}),t&&t.scrollInited||(addEvent(e,"scroll",uiScrollBox.onScroll),t.scrollInited=!0),onBodyResize(),uiScrollBox.onScroll()},hide:function(){var t=cur.lSTLOpts;t&&t.parent&&(removeEvent(t.parent,"scroll",uiScrollBox.onScroll),hide(cur.lSTL),cur.lSTLShown=0,t.onHide&&t.onHide())},show:function(){var t=cur.lSTLOpts;t&&t.parent&&(addEvent(t.parent,"scroll",uiScrollBox.onScroll),setTimeout(uiScrollBox.onScroll,0),t.onShow&&t.onShow())},lSTLDown:function(t){if(t=t||window.event,!checkEvent(t)){var i=cur.lSTLWrap;if(!__afterFocus){var e=0,s=i.scrollTop;cur.lSTLWasSet&&cur.lSTLWas?(e=cur.lSTLWas,cur.lSTLWas=0):cur.lSTLWas=s,i.scrollTop=e}return cancelEvent(t)}},onScroll:function(){if(cur.lSTL){var t=cur.lSTLWrap,i=t.scrollTop,e=200,s=cur.lSTLWas||i>e,o=0;if(cur.lSTL.style.marginTop=Math.min(i,boxLayer.scrollHeight-cur.lSTL.scrollHeight-1)+"px",vk.staticheader){var n=getSize("page_header_wrap")[1];cur.lSTLText.style.marginTop=Math.max(-Math.min(scrollGetY(),bodyNode.clientHeight-(window.lastWindowHeight||0)),-n)+"px"}s?(1!==cur.lSTLShown&&(show(cur.lSTL),cur.lSTLShown=1),cur.lSTLWas&&i>500&&(cur.lSTLWas=0),i>e?(o=(i-e)/e,cur.lSTLWasSet&&(cur.lSTLWasSet=0,val(domLC(cur.lSTL),getLang("global_to_top")),removeClass(domLC(cur.lSTL),"down"))):(o=(e-i)/e,cur.lSTLWas&&(cur.lSTLWasSet||(cur.lSTLWasSet=1,val(domLC(cur.lSTL),""),addClass(domLC(cur.lSTL),"down"))))):0!==cur.lSTLShown&&(hide(cur.lSTL),cur.lSTLShown=0),setStyle(cur.lSTL,{opacity:Math.min(Math.max(o,0),1)})}}},uiPhotoZoom={over:function(t,i,e){if(!browser.mobile&&!vk.widget){hasClass(t,"ui_zoom_wrap")||addClass(t,"ui_zoom_wrap"),cur.bigphCache=cur.bigphCache||{},e=e||{};var s=domFC(t),o=cur.bigphCache[i];"A"==s.tagName&&hasClass(s,"ui_zoom_outer")||(s=t.insertBefore(se(''),domFC(t)),s._uid=i,s.offsetHeight,addClass(s,"ui_zoom_added")),s.onclick=uiPhotoZoom.click.pbind(t,i,e),e.fastLoad&&uiPhotoZoom.load(t,i,e)}},click:function(t,i,e,s){if(!s||checkEvent(s)===!1){e.fastLoad||uiPhotoZoom.load(t,i,e);var o=cur.bigphCache[i];if(o)return"load"==o||"show"==o?(cur.bigphCache[i]="show",cancelEvent(s)):(e.onBeforeShow&&e.onBeforeShow(),extend(o,extend({jumpTo:{z:"albums"+i}},e.showOpts||{})),showPhoto(o._id,"album"+i+"_0/rev",o,s))}},load:function(t,i,e){var s=domFC(t),o=cur.bigphCache[i];void 0===o&&(cur.bigphCache[i]="load",ajax.post("al_photos.php",{act:"fast_get_photo",oid:i},{onDone:function(o){if(!o)return t.onmouseover=function(){},void re(s);var n="show"==cur.bigphCache[i];cur.bigphCache[i]=o,s.href="/photo"+o._id+"?all=1",n&&uiPhotoZoom.click(t,i,e)},onFail:function(){return t.onmouseover=function(){},re(domFC(t)),!0}}))}},uiScroll=function(){var t=function(i,e){if(!(i=t.ge(i)))throw new Error("uiScroll container is undefined");i.__uiScroll__&&i.__uiScroll__.destroy(),this.options=extend({global:!1,"native":!1,theme:"default",reversed:!1,autoresize:!0,preserveEdgeBelow:!1,barMinHeight:30,preserveEdgeBelowThreshold:20,stopScrollPropagation:!0,minContentHeight:0,onmoreThreshold:null,hidden:!1,shadows:!1,scrollElements:[],onresize:null,onscroll:null,onscrollstart:null,onscrollstop:null,ondrag:null,ondragstart:null,ondragstop:null,onupdate:null,onmore:null},e),this.options["native"]&&(this.options.shadows=!1),browser.mobile&&(this.options.stopScrollPropagation=!1),isArray(this.options.scrollElements)||(this.options.scrollElements=[]),this.removeEvents=[],this.removeElements=[],this.dragging=!1,this.dragged=!1,this.released=!0,this.noMore=!1,this.dragY=null,this.dragScroll=null,this.shadowTop=!1,this.shadowBottom=!1,this.unnecessary=!1,this.disabled=!1,this.stopped=!0,this.stoppedTimeout=null,this.fixSizeDefault=null,this.animation=null,this.barOuterHeight=null,this.barInnerHeight=null,this.currentFrame=null,this.blockerScrollTop=500,this.emitter=new EventEmitter,isFunction(this.options.onresize)&&this.emitter.addListener("resize",this.options.onresize),isFunction(this.options.onscroll)&&this.emitter.addListener("scroll",this.options.onscroll),isFunction(this.options.onscrollstart)&&this.emitter.addListener("scrollstart",this.options.onscrollstart),isFunction(this.options.onscrollstop)&&this.emitter.addListener("scrollstop",this.options.onscrollstop),isFunction(this.options.ondrag)&&this.emitter.addListener("drag",this.options.ondrag),isFunction(this.options.ondragstart)&&this.emitter.addListener("dragstart",this.options.ondragstart),isFunction(this.options.ondragstop)&&this.emitter.addListener("dragstop",this.options.ondragstop),isFunction(this.options.onupdate)&&this.emitter.addListener("update",this.options.onupdate),isFunction(this.options.onmore)&&this.emitter.addListener("more",this.options.onmore),this.el={container:i,overflow:ce("div",{className:"ui_scroll_overflow"}),outer:ce("div",{className:"ui_scroll_outer"},{margin:this.options.stopScrollPropagation?this.blockerScrollTop+"px 0":void 0}),inner:ce("div",{className:"ui_scroll_inner"}),shadowTop:ce("div",{className:"ui_scroll_shadow_top"}),shadowBottom:ce("div",{className:"ui_scroll_shadow_bottom"}),content:ce("div",{className:"ui_scroll_content"}),barContainer:ce("div",{className:"ui_scroll_bar_container"}),barOuter:ce("div",{className:"ui_scroll_bar_outer"}),barInner:ce("div",{className:"ui_scroll_bar_inner"})};var s=cf(),o=["ui_scroll_container"];for(each(isArray(this.options.theme)?this.options.theme:trim(this.options.theme+"").split(/\s+/),function(t,i){i&&o.push("ui_scroll_"+i+"_theme")}),addClass(this.el.container,o.join(" ")),this.options.hidden&&addClass(this.el.container,"ui_scroll_hidden");this.el.container.firstChild;)this.el.content.appendChild(this.el.container.firstChild);if(this.el.outer.appendChild(this.el.inner),this.el.inner.appendChild(this.el.content),this.options.stopScrollPropagation?(this.el.blocker=ce("div",{className:"ui_scroll_blocker"}),this.addEvent(this.el.blocker,"scroll",this.fixBlocker.bind(this),!0),this.el.blocker.appendChild(this.el.outer),this.el.overflow.appendChild(this.el.blocker)):this.el.overflow.appendChild(this.el.outer),s.appendChild(this.el.overflow),this.options["native"]?addClass(this.el.container,"ui_scroll_native"):(this.el.barOuter.appendChild(this.el.barInner),this.el.barContainer.appendChild(this.el.barOuter),s.appendChild(this.el.barContainer),this.options.shadows&&(this.el.overflow.appendChild(this.el.shadowTop),this.el.overflow.appendChild(this.el.shadowBottom)),browser.mobile||this.options.scrollElements.push(this.el.barContainer)),this.options.autoresize){var n=t.addResizeSensor(this.el.inner,this.resize.bind(this,!0)),r=t.addResizeSensor(this.el.overflow,this.resize.bind(this,!1));this.removeElements.push(n[0]),this.removeElements.push(r[0]),this.startResizeListening=function(){n[1](),r[1]()}}this.removeElements.push(this.el.overflow,this.el.barContainer),this.el.container.appendChild(s),this.options.reversed&&(this.el.outer.scrollTop=this.el.outer.scrollHeight),this.el.container.__uiScroll__=this.api={container:this.el.container,scroller:this.el.outer,content:this.el.content,emitter:this.emitter,ondragstart:this.dragstart.bind(this),ondragstop:this.dragstop.bind(this),ondrag:this.drag.bind(this),destroy:this.destroy.bind(this),disable:this.disable.bind(this,!0),enable:this.disable.bind(this,!1),scrollTop:this.scrollTop.bind(this),scrollBottom:this.scrollBottom.bind(this),scrollBy:this.scrollBy.bind(this),scrollIntoView:this.scrollIntoView.bind(this),update:this.init.bind(this),updateAbove:this.updateAbove.bind(this),updateBelow:this.updateBelow.bind(this),data:{scrollTop:null,scrollBottom:null,scrollHeight:null,viewportHeight:null}},this.init();var l="onwheel"in this.el.outer?"wheel":void 0!==document.onmousewheel?"mousewheel":browser.mozilla?"MozMousePixelScroll":"DOMMouseScroll";return this.addEvent(this.el.container,l,function(t){this.animation&&this.animation.stop(),this.options.stopScrollPropagation&&!this.disabled&&(this.isScrollEventUnused(t)?cancelEvent(t):stopEvent(t))}.bind(this),!this.options.stopScrollPropagation),this.options["native"]||this.addEvent(this.el.barContainer,"mousedown",this.dragstart.bind(this)),each(this.options.scrollElements,function(t,i){this.addEvent(i,l,function(t){this.disabled||(this.scrollBy(this.scrollEventDelta(t)),(this.options.stopScrollPropagation||!this.isScrollEventUnused(t))&&cancelEvent(t))}.bind(this))}.bind(this)),this.options.reversed&&this.addEvent(this.el.container,"mousedown touchstart pointerdown",function(t){this.released=!1,this.noMore=!0;var i=this.addEvent(document,"mouseup contextmenu touchend pointerup",function(t){removeEvent(i),this.released=!0,this.noMore&&this.stopped&&!this.dragging&&(this.noMore=!1,this.more())}.bind(this))}.bind(this)),this.addEvent(this.el.outer,"scroll",function(){this.update()&&(this.stopped?(this.stopped=!1,this.emitEvent("scrollstart")):this.options["native"]||this.stopped!==!1||(this.stopped=0,addClass(this.el.container,"ui_scroll_scrolled")),this.emitEvent("scroll"),this.stoppedTimeout&&clearTimeout(this.stoppedTimeout),this.stoppedTimeout=setTimeout(function(){this.stopped||(this.stopped=!0,this.options["native"]||removeClass(this.el.container,"ui_scroll_scrolled"),this.emitEvent("scrollstop"),this.noMore&&this.released&&!this.dragging&&(this.noMore=!1,this.more()))}.bind(this),200))}.bind(this)),this.api};return t.prototype={init:function(){if(this.options.stopScrollPropagation&&this.fixBlocker(),!this.inited){if(!this.el.container.scrollWidth||this.disabled)return;this.fixSize(!0),this.options.autoresize&&this.startResizeListening(),this.options.global||cur.destroy.push(this.destroy.bind(this)),this.inited=!0}return this.update(!0),this.api},addEvent:function(t,i,e,s){return this.removeEvents.push([t,i,e]),addEvent(t,i,e,void 0,void 0,s?{passive:!0}:void 0),e},destroy:function(){if(this.disabled=!0,this.fixSize(),this.animation&&this.animation.stop(),this.moreTimeout&&clearTimeout(this.moreTimeout),this.dragstopHandler&&removeEvent(document,"mouseup contextmenu",this.dragstopHandler),this.dragHandler&&removeEvent(document,"mousemove",this.dragHandler),each(this.removeEvents,function(t,i){removeEvent.apply(null,i)}),this.el.overflow.parentNode==this.el.container){for(var t=cf();this.el.content.firstChild;)t.appendChild(this.el.content.firstChild);this.el.container.appendChild(t)}return this.el.container.className=this.el.container.className.replace(/\bui_scroll_.+?\b/g," "),each(this.removeElements,function(t,i){re(i)}),this.el.container.scrollTop=this.api.data.scrollTop,delete this.el.container.__uiScroll__,this.api},updateAbove:function(t){if(isFunction(t)){this.animation&&this.animation.stop();var i=this.el.outer.scrollHeight-this.el.outer.scrollTop-this.el.overflow.offsetHeight;t(),this.el.outer.scrollTop=this.el.outer.scrollHeight-this.el.overflow.offsetHeight-i}return this.api},updateBelow:function(t){if(isFunction(t)){this.animation&&this.animation.stop();var i=this.options.preserveEdgeBelow&&this.api.data.scrollBottom<=this.options.preserveEdgeBelowThreshold;t(),i&&this.scrollBottom()}return this.api},fixBlocker:function(){browser.chrome&&(this.el.blocker.style.display="inline-block",this.el.blocker.offsetHeight,this.el.blocker.style.display=""),this.el.blocker.scrollTop=this.blockerScrollTop},fixSize:function(t){this.options["native"]||(t&&null==this.fixSizeDefault&&(this.fixSizeDefault=this.el.container.style.width),setStyle(this.el.container,"width",t?getSize(this.el.container,!0)[0]||this.fixSizeDefault||"":this.fixSizeDefault||""))},emitEvent:function(t){this.disabled||this.inited&&this.emitter.emitEvent(t,[this.api])},scrollEventDelta:function(t){var i=0,e=void 0!==t.deltaMode?t.deltaMode:"MozMousePixelScroll"==t.type?0:1,s=15,o=30*s;return"wheel"==t.type?i=t.deltaY:void 0!==t.wheelDeltaX&&void 0!==t.wheelDeltaY?(i=.025*-t.wheelDeltaY,browser.mac&&browser.opera&&(i*=.1)):void 0!==t.wheelDelta?i=.025*-t.wheelDelta:t.detail&&2===t.axis&&(i=t.detail),i*(1==e?s:2==e?o:1)},isScrollEventUnused:function(t,i){var i=this.scrollEventDelta(t);return i>0?!this.api.data.scrollBottom:!this.api.data.scrollTop},resize:function(t){if(!t&&this.options.preserveEdgeBelow){var i=this.options.preserveEdgeBelow&&this.api.data.scrollBottom<=this.options.preserveEdgeBelowThreshold;this.update(!0)&&(this.emitEvent("resize"),i&&this.scrollBottom(),this.options.stopScrollPropagation&&this.fixBlocker());
}else this.update(!0)&&(this.options.stopScrollPropagation&&this.fixBlocker(),this.emitEvent("resize"))},disable:function(t){return this.disabled=!!t,t?(this.animation&&this.animation.stop(),this.fixSize()):(this.fixSize(!0),this.update(!0)),toggleClass(this.el.container,"ui_scroll_disabled",this.disabled),this.api},dragstart:function(t){return this.disabled||this.dragging||this.options["native"]?void 0:(t||(t=window.event),this.dragging=!0,this.animation&&this.animation.stop(),this.options.reversed&&(this.noMore=!0),addEvent(document,"mouseup contextmenu",this.dragstartHandler=this.dragstop.bind(this)),addEvent(document,"mousemove",this.dragHandler=this.drag.bind(this)),this.dragScroll=this.options.reversed?this.api.data.scrollBottom:this.api.data.scrollTop,this.dragY=t.screenY,cancelEvent(t),this.emitEvent("dragstart"),this.api)},dragstop:function(t){return this.disabled||!this.dragging||this.options["native"]?void 0:(t||(t=window.event),this.dragging=!1,this.dragstopHandler&&removeEvent(document,"mouseup contextmenu",this.dragstopHandler),this.dragHandler&&removeEvent(document,"mousemove",this.dragHandler),setStyle(bodyNode,"cursor",""),removeClass(this.el.container,"ui_scroll_dragging"),this.dragged?this.noMore&&(this.noMore=!1,this.more()):(this.options.reversed&&(this.noMore=!0),this.scrollTop((t.pageY-getXY(this.el.barOuter)[1]-this.barInnerHeight/2)*(Math.max(this.options.minContentHeight,this.api.data.scrollHeight)-this.api.data.viewportHeight)/(this.barOuterHeight-this.barInnerHeight),0,function(){this.noMore&&(this.noMore=!1,this.more())}.bind(this))),this.dragged=!1,t&&"contextmenu"!==t.type&&cancelEvent(t),this.emitEvent("dragstop"),this.api)},drag:function(t){if(!this.disabled&&this.dragging&&!this.options["native"]){t||(t=window.event);var i=(t.screenY-this.dragY)*(this.api.data.scrollHeight/this.el.barOuter.scrollHeight);return this.el.outer.scrollTop=this.options.reversed?this.el.outer.scrollHeight-this.el.overflow.offsetHeight-this.dragScroll+i:this.dragScroll+i,this.dragged||(this.dragged=!0,setStyle(bodyNode,"cursor","pointer"),addClass(this.el.container,"ui_scroll_dragging")),cancelEvent(t),this.emitEvent("drag"),this.api}},scroll:function(t,i,e){return this.animation&&this.animation.stop(),this.el.outer.scrollTop==t&&this.update(!0),i?(i="number"!=typeof i||!isFinite(i)||i%1?300:Math.abs(i),this.animation=new Fx.Base({scrollTop:this.el.outer.scrollTop},{transition:Fx.Transitions.easeOutCubic,onStep:function(t){this.el.outer.scrollTop=t.scrollTop}.bind(this),duration:i,onComplete:isFunction(e)?e.pbind(this.api):void 0}).start({scrollTop:this.el.outer.scrollTop},{scrollTop:t})):(this.el.outer.scrollTop=t,isFunction(e)&&e(this.api)),this.api},scrollTop:function(t,i,e){return this.disabled||this.dragging?void 0:this.scroll(intval(t),i,e)},scrollBottom:function(t,i,e){return this.disabled||this.dragging?void 0:this.scroll(this.el.outer.scrollHeight-this.el.overflow.offsetHeight-intval(t),i,e)},scrollBy:function(t,i,e){return this.disabled||this.dragging?void 0:this.scroll(this.el.outer.scrollTop+intval(t),i,e)},scrollIntoView:function(i,e,s){if((i=t.ge(i))&&i.compareDocumentPosition(this.el.content)&Node.DOCUMENT_POSITION_CONTAINS){var o=getXY(i)[1],n=getXY(this.el.overflow)[1],r=getSize(i)[1];n>=o&&o+r>=n+this.api.data.viewportHeight||o>=n&&o+r<=n+this.api.data.viewportHeight?isFunction(s)&&(e?setTimeout(s.bind(this.api),0):s(this.api)):r>this.api.data.viewportHeight||n>o?this.scrollTop(o-n+this.api.data.scrollTop-(this.options.shadows?getSize(this.el.shadowTop)[1]:0),e,s):this.scrollTop(o-n+this.api.data.scrollTop+r-this.api.data.viewportHeight+(this.options.shadows?getSize(this.el.shadowBottom)[1]:0),e,s)}return this.api},nextFrame:function(){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,1)},i=window.cancelAnimationFrame||window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;return function(e){this.currentFrame&&i(this.currentFrame),this.currentFrame=t(e)}}(),update:function(t){var i,e,s=this.el.outer.scrollTop;return this.inited&&!this.disabled&&(t&&(i=this.el.inner.offsetHeight,this.api.data.viewportHeight!==(this.api.data.viewportHeight=this.el.overflow.offsetHeight)||this.api.data.scrollHeight!==i)||this.api.data.scrollTop!==s)?(t&&(this.api.data.scrollHeight=i),this.api.data.scrollTop=Math.min(this.api.data.scrollHeight-this.api.data.viewportHeight,Math.max(0,s)),this.api.data.scrollBottom=Math.max(0,this.api.data.scrollHeight-this.api.data.scrollTop-this.api.data.viewportHeight),this.options["native"]||(i=Math.max(this.options.minContentHeight,this.api.data.scrollHeight),e=i<=this.api.data.viewportHeight,e||(t&&(this.barOuterHeight=this.el.barOuter.offsetHeight,this.barInnerHeight=Math.max(this.options.barMinHeight,this.barOuterHeight*this.api.data.viewportHeight/i),this.el.barInner.style.height=this.barInnerHeight+"px"),this.nextFrame(function(t){this.style.transform=t}.bind(this.el.barInner,"translateY("+(this.barOuterHeight-this.barInnerHeight)*this.api.data.scrollTop/(i-this.api.data.viewportHeight)+"px)"))),this.options.shadows&&(this.shadowTop!=(this.api.data.scrollTop&&!e)&&toggleClass(this.el.container,"ui_scroll_shadow_top_visible",this.shadowTop=this.api.data.scrollTop&&!e),this.shadowBottom!=(this.api.data.scrollBottom&&!e)&&toggleClass(this.el.container,"ui_scroll_shadow_bottom_visible",this.shadowBottom=this.api.data.scrollBottom&&!e)),this.unnecessary!==e&&(toggleClass(this.el.container,"ui_scroll_unnecessary",e),this.unnecessary=e,this.options.stopScrollPropagation&&this.fixBlocker(),e&&this.barInnerHeight&&this.barOuterHeight&&this.nextFrame(function(t){this.el.barInner.style.height=100*this.barInnerHeight/this.barOuterHeight+"%",this.el.barInner.style.transform="translateY("+(this.barOuterHeight-this.barInnerHeight)*this.api.data.scrollTop/(i-this.api.data.viewportHeight)*100/this.barInnerHeight+"%)"}.bind(this)))),this.emitEvent("update"),(!this.options.reversed||s>=0)&&this.more(),!0):!1},more:function(){!this.noMore&&(this.options.reversed?this.api.data.scrollTop:this.api.data.scrollBottom)<=(null!==this.options.onmoreThreshold?this.options.onmoreThreshold:2*this.api.data.viewportHeight)&&this.emitEvent("more")}},t.ge=function(t){return t=isString(t)&&"_"===t[0]?geByClass1(t):ge(t)},t.addResizeSensor=function(i,e){if((i=t.ge(i))&&isFunction(e)){if(browser.msie9||browser.opera&&browser.version<13){var s=!1,o=!1,n=function(){return r.contentDocument?(removeEvent(r.contentDocument.defaultView,"resize"),addEvent(r.contentDocument.defaultView,"resize",e),void e()):setTimeout(n,100)},r=ce("object",{type:"text/html",className:"ui_scroll_resize_object",data:browser.msie9?"javascript: ''":"about:blank",onload:function(){o=!0,s&&n()}});return i.appendChild(r),i.__resizeSensor__=[r,function(){s=!0,o&&n()}]}var r=ce("div",{className:"ui_scroll_resize_sensor"}),l=ce("div",{className:"ui_scroll_resize_sensor ui_scroll_resize_expand"}),a=ce("div",{className:"ui_scroll_resize_sensor ui_scroll_resize_shrink"}),h=ce("div"),d=ce("div"),c=null;return l.appendChild(h),a.appendChild(d),r.appendChild(l),r.appendChild(a),i.appendChild(r),i.__resizeSensor__=[r,l.onscroll=a.onscroll=function(){var t=(i.offsetWidth||1e4)+10,s=(i.offsetHeight||1e4)+10;h.style.width=t+"px",h.style.height=s+"px",l.scrollLeft=t,l.scrollTop=s,a.scrollLeft=t,a.scrollTop=s,c!==(c=t+" "+s)&&e()}]}},t}();window.Scrollbar=window.Scrollbar||function(){function t(t){if(!this.inited)return!1;if(t||(t=window.event),this.isHorizontal){var i=Math.floor((this.contWidth()-this.scrollWidth)*Math.min(1,(t.screenX-this.moveX)/(this.scrollbarSize-this.innerWidth-6)));isFunction(this.options.onScroll)&&this.options.onScroll(this.obj.scrollLeft-i,this),this.obj.scrollLeft=i}else{var i=Math.floor((this.contHeight()-this.scrollHeight)*Math.min(1,(t.screenY-this.moveY)/(this.scrollbarSize-this.innerHeight-6)));isFunction(this.options.onScroll)&&this.options.onScroll(this.obj.scrollTop-i,this),this.obj.scrollTop=i}return this.update(!0),!1}function i(){return this.inited?(this.moveY=this.moveX=this.isDown=!1,this.isOut&&this.contOut(),removeEvent(document,"mousemove",this.mouseMove),removeEvent(document,"mouseup",this.mouseUp),setStyle(document.body,"cursor","default"),setStyle(this.obj,{pointerEvents:""}),removeClass(this.inner,"scrollbar_hovered"),isFunction(this.options.stopDrag)&&this.options.stopDrag(),isFunction(this.options.onHold)&&this.options.onHold(!1),!1):!1}function e(t){if(!this.inited)return!1;if(!this.moveY&&!checkEvent(t))return t||(t=window.event),addEvent(document,"mousemove",this.mouseMove),addEvent(document,"mouseup",this.mouseUp),setStyle(document.body,"cursor","pointer"),setStyle(this.obj,{pointerEvents:"none"}),this.isHorizontal?this.moveX=t.screenX-(this.inner.offsetLeft||0):this.moveY=t.screenY-(this.inner.offsetTop||0),addClass(this.inner,"scrollbar_hovered"),isFunction(this.options.startDrag)&&this.options.startDrag(),isFunction(this.options.onHold)&&this.options.onHold(!0),this.isDown=!0,cancelEvent(t)}function s(t){switch(t||(t=window.event),t.keyCode){case 40:this.obj[this.scrollProp]+=40;break;case 38:this.obj[this.scrollProp]-=40;break;case 34:this.obj[this.scrollProp]+=this[this.scrollDimensionProp];break;case 33:this.obj[this.scrollProp]-=this[this.scrollDimensionProp];break;default:return!0}return this.update(!0),cancelEvent(t)}function o(o,n){this.obj=o=ge(o),this.options=extend({nomargin:!1,horizontal:!1,top:0,bottom:0,padding:3,prefix:"",hidden:0},n||{}),this.isHorizontal=this.options.horizontal,this.scrollProp=this.isHorizontal?"scrollLeft":"scrollTop",this.scrollDimensionProp=this.isHorizontal?"scrollWidth":"scrollHeight",this.topShadow=!1,this.bottomShadow=!1,this[this.scrollProp+"Last"]=this.obj[this.scrollProp],this.destroyList=[],this.mouseDown=e.bind(this),this.mouseMove=t.bind(this),this.mouseUp=i.bind(this),setTimeout(function(){setStyle(o,{overflow:"hidden"}),this.scrollbar=ce("div",{className:(this.options.prefix?this.options.prefix+"scrollbar_cont ":"")+"scrollbar_cont"+(this.isHorizontal?" scrollbar_cont_horiz":"")+(this.options.hidden?" scrollbar_hidden":"")}),this.inner=ce("div",{className:(this.options.prefix?this.options.prefix+"scrollbar_inner ":"")+"scrollbar_inner"}),this.scrollbar.appendChild(this.inner);var t=this.widthUpdated();this.options.shadows&&(o.parentNode.insertBefore(this.topShadowDiv=ce("div",{className:(this.options.prefix?this.options.prefix+"scrollbar_top ":"")+"scrollbar_top"},{width:t[0]}),o),o.parentNode.insertBefore(this.bottomShadowDiv=ce("div",{className:(this.options.prefix?this.options.prefix+"scrollbar_bottom ":"")+"scrollbar_bottom"},{width:t[0]}),o.nextSibling)),o.parentNode.insertBefore(this.scrollbar,o);var i=s.bind(this),e=this.wheel.bind(this),n="onwheel"in ce("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":browser.mozilla?"MozMousePixelScroll":"DOMMouseScroll";if(addEvent(o,n,e),addEvent(this.scrollbar,n,e),this.options.scrollElements&&each(this.options.scrollElements,function(t,i){addEvent(i,n,e)}),addEvent(this.scrollbar,"mouseover",this.contOver.bind(this)),addEvent(this.scrollbar,"mouseout",this.contOut.bind(this)),addEvent(this.scrollbar,"mousedown",this.contDown.bind(this)),browser.safari_mobile){var r=function(t){this.isHorizontal?cur.touchX=t.touches[0].pageX:cur.touchY=t.touches[0].pageY}.bind(this),l=function(t){return this.isHorizontal?(cur.touchDiff=cur.touchX-(cur.touchX=t.touches[0].pageX),o.scrollLeft+=cur.touchDiff,o.scrollLeft>0&&this.shown!==!1&&this.update(!0)):(cur.touchDiff=cur.touchY-(cur.touchY=t.touches[0].pageY),o.scrollTop+=cur.touchDiff,o.scrollTop>0&&this.shown!==!1&&this.update(!0)),cancelEvent(t)}.bind(this),a=function(){cur.animateInt=setInterval(function(){cur.touchDiff=.9*cur.touchDiff,cur.touchDiff<1&&cur.touchDiff>-1?clearInterval(cur.animateInt):(o[self.scrollProp]+=cur.touchDiff,this.update(!0))}.bind(this),0)}.bind(this);addEvent(o,"touchstart",r),addEvent(o,"touchmove",l),addEvent(o,"touchend",a),this.destroyList.push(function(){removeEvent(o,"touchstart",r),removeEvent(o,"touchmove",l),removeEvent(o,"touchend",a)})}addEvent(this.inner,"mousedown",this.mouseDown),this.options.nokeys?this.onkeydown=i:addEvent(window,"keydown",i),this.destroyList.push(function(){removeEvent(o,n,e),this.options.scrollElements&&each(this.options.scrollElements,function(t,i){removeEvent(i,n,e)}),removeEvent(this.inner,"mousedown",this.mouseDown),removeEvent(window,"keydown",i),re(this.scrollbar)}.bind(this)),this.isHorizontal||(this.contHeight()<=this.scrollHeight?hide(this.bottomShadowDiv):this.bottomShadow=!0),this.options.onInit&&this.options.onInit(),this.inited=!0,this.update(!0),this.options.global||cur.destroy.push(this.destroy.bind(this))}.bind(this),0)}return o.prototype={wheel:function(t){if(!this.disabled){t||(t=window.event);var i=0,e=this.obj[this.scrollProp];if(deltaMode=void 0!==t.deltaMode?t.deltaMode:"MozMousePixelScroll"==t.type?0:1,pixelRatio=1,pixelsPerLine=15,pixelsPerPage=30*pixelsPerLine,"wheel"==t.type?i=-(this.isHorizontal?t.deltaX:t.deltaY):void 0!==t.wheelDeltaX&&void 0!==t.wheelDeltaY?(i=.025*(this.isHorizontal?t.wheelDeltaX:t.wheelDeltaY),browser.mac&&browser.opera&&(i*=.1)):void 0!==t.wheelDelta?i=.025*t.wheelDelta:t.detail&&t.axis===(this.isHorizontal?1:2)&&(i=-t.detail),i=i*pixelRatio*(1==deltaMode?pixelsPerLine:2==deltaMode?pixelsPerPage:1))return this.obj[this.scrollProp]-=i,isFunction(this.options.onScroll)&&this.options.onScroll(i,this),e!=this.obj[this.scrollProp]&&this.shown!==!1&&(this.update(!0),addClass(this.inner,"scrollbar_hovered"),clearTimeout(this.moveTimeout),this.moveTimeout=setTimeout(function(){removeClass(this.inner,"scrollbar_hovered")}.bind(this),300)),!this.shown&&!this.options.forceCancelEvent||this.isHorizontal&&e==this.obj[this.scrollProp]?void 0:!1}},setOptions:function(t){extend(this.options,t)},widthUpdated:function(){var t,i=getSize(this.obj);return t=this.isHorizontal?{marginLeft:this.options.top+"px",marginTop:i[1]+3+"px",width:i[0]-this.options.top-this.options.bottom+"px"}:{marginTop:this.options.top+"px",marginLeft:this.options.nomargin?0:i[0]-(this.options.mlDiff||7)+"px",height:i[1]-this.options.top-this.options.bottom+"px"},this.options.nomargin&&(void 0!==this.options.right&&"auto"!==this.options.right?(t.right=this.options.right,t.left="auto"):void 0!==this.options.left&&(t.right="auto",t.left=this.options.left)),this.scrollWidth=i[0],this.scrollHeight=i[1],this.scrollbarSize=i[this.isHorizontal?0:1]-this.options.top-this.options.bottom,setStyle(this.scrollbar,t),setTimeout(function(){removeClass(this.scrollbar,"no_transition")}.bind(this)),i},contOver:function(){this.isOut=!1,this.shown&&addClass(this.scrollbar,"scrollbar_c_overed")},contOut:function(){this.isOut=!0,this.isDown||removeClass(this.scrollbar,"scrollbar_c_overed")},contDown:function(t){if(t||(t=window.event),this.isHorizontal){var i=t.offsetX-this.innerWidth/2+5,e=this.scrollbarSize-this.innerWidth;this.obj.scrollLeft=Math.floor((this.contWidth()-this.scrollWidth)*Math.min(1,i/e))}else{var i=t.offsetY-this.innerHeight/2+5,e=this.scrollbarSize-this.innerHeight;this.obj.scrollTop=Math.floor((this.contHeight()-this.scrollHeight)*Math.min(1,i/e))}this.update(!0),this.mouseDown(t)},hide:function(t){hide(this.topShadowDiv,this.bottomShadowDiv,this.scrollbar),this.hidden=!0},show:function(t){show(this.topShadowDiv,this.bottomShadowDiv,this.scrollbar),this.hidden=!1},disable:function(){this.hide(),this[this.scrollProp](0),this.disabled=!0},enable:function(){this.show(),this.update(),this.disabled=!1},getScrollHeight:function(){return this.scrollHeight},scrollTop:function(t){return"undefined"==typeof t?this.obj.scrollTop:(this.obj.scrollTop=parseInt(t),void this.update(!1,!0))},scrollBottom:function(t){return"undefined"==typeof t?this.contHeight()-this.scrollHeight-this.obj.scrollTop:(this.obj.scrollTop=this.contHeight(!0)-this.scrollHeight-t,void this.update(!0,!0))},smoothScroll:function(t,i,e){var s=this.obj.scrollTop+t;"undefined"==typeof e&&(e=300);var o=this,n=new Fx.Base({scrollTop:this.obj.scrollTop},{transition:Fx.Transitions.easeOutCubic,onStep:function(t){o.obj.scrollTop=t.scrollTop,o.update(!0)},duration:e,onComplete:function(){i&&i(scroll)}});n.start({scrollTop:this.obj.scrollTop},{scrollTop:s})},scrollLeft:function(t){this.obj.scrollLeft=parseInt(t),this.update(!1,!0)},destroy:function(t){each(this.destroyList||[],function(t,i){i()})},contHeight:function(){return Math.round(this.options.contHeight||this.obj.scrollHeight)},contWidth:function(){return Math.round(this.options.contWidth||this.obj.scrollWidth)},val:function(t){return t&&(this.obj[this.scrollProp]=t,this.update(!0,!0)),this.obj[this.scrollProp]},update:function(t,i){if(this.inited&&!this.hidden){if(!t&&(this.isHorizontal?this.moveX:this.moveY))return!0;var e,s,o;if(i&&(e=getSize(this.obj),this.isHorizontal?(this.scrollWidth=e[0],e=Math.round(this.scrollWidth-this.options.top-this.options.bottom),this.scrollbarSize!==e&&(this.scrollbar.style.width=e+"px")):(this.scrollHeight=e[1],e=Math.round(this.scrollHeight-this.options.top-this.options.bottom),this.scrollbarSize!==e&&(this.scrollbar.style.height=e+"px")),this.scrollbarSize=e),this.isHorizontal?(e=this.contWidth())<=Math.round(this.scrollWidth):(e=this.contHeight())<=Math.round(this.scrollHeight))return hide(this.inner,this.bottomShadowDiv,this.topShadowDiv),this.scrollbar.style.pointerEvents="none",this.topShadow=this.bottomShadow=this.shown=!1,isFunction(this.options.more)&&e-this.obj[this.scrollProp]<2*this[this.scrollDimensionProp]&&this.options.more(this),void(this[this.scrollProp+"Last"]=this.obj[this.scrollProp]);this.shown||(show(this.inner),this.scrollbar.style.pointerEvents="",this.shown=!0);var o=this.val();isFunction(this.options.scrollChange)&&this.options.scrollChange(o),this.lastProgress=Math.min(1,o/(e-(this.isHorizontal?this.scrollWidth:this.scrollHeight))),this.lastProgress>0!=this.topShadow&&((this.topShadow=!this.topShadow)?show:hide)(this.topShadowDiv),this.lastProgress<1!=this.bottomShadow&&((this.bottomShadow=!this.bottomShadow)?show:hide)(this.bottomShadowDiv),this.isHorizontal?(s=Math.max(40,Math.floor(this.scrollbarSize*this.scrollWidth/e)),s!==this.innerWidth&&(this.inner.style.width=(this.innerWidth=s)+"px"),this.inner.style.marginLeft=(this.scrollbarSize-s-2*this.options.padding)*this.lastProgress+this.options.padding+"px"):(s=Math.max(40,Math.floor(this.scrollbarSize*this.scrollHeight/e)),s!==this.innerHeight&&(this.inner.style.height=(this.innerHeight=s)+"px"),this.inner.style.marginTop=(this.scrollbarSize-s-2*this.options.padding)*this.lastProgress+this.options.padding+"px"),isFunction(this.options.more)&&e-this.obj[this.scrollProp]<2*this[this.scrollDimensionProp]&&this.options.more(this),this[this.scrollProp+"Last"]=this.obj[this.scrollProp]}},restore:function(){this.obj[this.scrollProp]=this[this.scrollProp+"Last"]}},o}(),extend(OList.prototype,{onScroll:function(){var t=domPN(this.box.bodyNode),i=this.moreEl,e=this.scrollNode,s=e.scrollHeight,o=e.scrollTop,n=e.offsetHeight||e.clientHeight;toggleClass(t,"olist_topsh",o>0),toggleClass(t,"olist_botsh",s>o+n),i&&i.offsetTop&&i.onclick&&o+n+200>=s&&i.onclick()},onMouseEvent:function(t){var i=t.originalTarget||t.target;if(hasClass(i,"olist_item_wrap")||(i=gpeByClass("olist_item_wrap",i)),i&&i!=bodyNode){if(hasClass(i,"olist_item_loading"))return cancelEvent(t);if(checkEvent(t))return!0;this.box.changed=!0;var e=i.id.match(/-?\d+/)[0],s=!this.invertedSelection&&this.selected[e]||this.invertedSelection&&!this.selected[e];if(toggleClass(i,"olist_item_wrap_on",!s),this.selected[e]=!s||this.invertedSelection,this.selCnt+=!s||this.invertedSelection?1:-1,this.selTabUpdate(),this.onListClick&&this.onListClick(i,s),this.scrollNode.scrollTop<50){var o=this.filter;setTimeout(elfocus.pbind(o),100)}return cancelEvent(t)}},onOlistSelect:function(t,i){uiActionsMenu.toggle(this.olistFilter,!1);var e=this.selCnt,s=this.selected;switch(i.ctrlKey||i.metaKey||i.shiftKey||(s={},e=0),t){case"all":s={},e=0,each(this.owners,function(){s[this[0]]=1,e++});break;case"none":s={},e=0;break;case"people":each(this.owners,function(){this[0]>0&&!s[this[0]]&&(s[this[0]]=1,e++)});break;case"groups":each(this.owners,function(){this[0]<0&&!s[this[0]]&&(s[this[0]]=1,e++)});break;default:var o=intval(t.replace("list","")),n=1<i+r)?!1:void 0}),s=h}var d=s.length;s=s.slice(i,i+r);var c=[];if(t){t=clean(t);var u=escapeRE(t),p=parseLatin(t);null!=p&&(u=u+"|"+escapeRE(p));var g=new RegExp("(?![^&;]+;)(?!<[^<>]*)((\\(*)("+u+"))(?![^<>]*>)(?![^&;]+;)","gi")}var m=l.rsTpl?l.rsTpl:function(t,i,e,s,o){var n=!e&&s[t[0]]||e&&!s[t[0]],r=t[1];if(i){r=-1==i.indexOf(" ")?r.split(" "):[r];var l="";for(var a in r)l+=(a>0?" ":"")+r[a].replace(o,"$2$3");r=l}return{id:t[0],name:r,photo:t[2],classname:n?" olist_item_wrap_on":"",link:t[3]||(t[0]>0?"id"+t[0]:"club"+-t[0])}};each(s,function(){c.push(rs(n,m(this,t,l.invertedSelection,o,g)))}),i||c.length||c.push(''+(t?getLang("global_search_not_found").replace("{search}",t):l.noSelMsg)+"
"),re(this.moreEl),c=c.join(" "),i?this.olistEl.appendChild(cf(c)):val(this.olistEl,c),d>i+r&&(this.olistEl.appendChild(this.moreEl),this.moreEl.onclick=function(e){return l.renderList(t,i+r),cancelEvent(e)}),l.box&&l.box.scroll&&l.box.scroll.update(!1,!0),l.onScroll()}});var uiBox={addShadows:function(t){setTimeout(function(){var i=domFC(t.bodyNode),e=function(){toggleClass(domPN(t.bodyNode),"box_topsh",i.scrollTop>0),toggleClass(domPN(t.bodyNode),"box_botsh",i.scrollTop+(i.offsetHeight||i.clientHeight)'),domPN(this._slideEl).insertBefore(i,this._slideEl),delete this._width,addClass(this._el,"slider_ad_marker_shown")}}else re(i),delete this._width,removeClass(this._el,"slider_ad_marker_shown")},Slider.prototype.showAdMarker=function(t){var i=se('');domPN(this._slideEl).insertBefore(i,this._slideEl),delete this._width,addClass(this._el,"slider_ad_marker_shown")},Slider.prototype.isAdMode=function(){return hasClass(this._el,"slider_ad_mode")},Slider.prototype.toggleLoading=function(t){t=!!t,toggle(this._progressEl,t),setStyle(this._progressEl,"opacity",t?1:0)},Slider.prototype.destroy=function(t){this.options.formatHint&&(removeEvent(this._el,"mousemove",this._ev_onMouseOver),removeEvent(this._el,"mouseleave",this._ev_onMouseLeave),removeEvent(this._el,"mousedown",this._ev_onMouseDown)),re(this._el),re(this._currHintEl)},Slider.prototype._updateHint=function(t,i){this._currHintEl||(this._currHintEl=se(''),this.options.hintClass&&addClass(this._currHintEl,this.options.hintClass),this._el.appendChild(this._currHintEl)),this._width=this._width||getSize(this._slideEl)[0];var e=this._getPos(),s=Math.round(t.pageX-e[0]),o=this._width;if(s=i?Math.min(Math.max(0,s),o):s,s>=0&&o>=s){var n=s/o;this._currHintEl.innerHTML=this.options.formatHint?this.options.formatHint.call(this,n):n;var r=getSize(this._currHintEl);setStyle(this._currHintEl,{left:this._slideEl.offsetLeft+s-r[0]/2,top:this._slideEl.offsetTop-r[1]-10}),!i&&this._toggleHint(!0)}else!i&&this._toggleHint(!1);this.options.formatHint||this._toggleHint(!1)},Slider.prototype._toggleHint=function(t){this.isAdMode()&&(t=!1),toggleClass(this._currHintEl,"visible",t)},Slider.prototype._onMouseOver=function(t){Slider._currenSliderDrag||hasClass(this._el,"active")||this._updateHint(t)},Slider.prototype._onMouseLeave=function(t){hasClass(this._el,"active")||this._toggleHint(!1)},Slider.prototype._onMouseDown=function(t){0==t.button&&(delete cur._sliderMouseUpNowEl,this._adState||(addEvent(window,"mousemove",this._ev_onMouseMove=this._onMouseMove.bind(this)),addEvent(window,"mouseup",this._ev_onMouseUp=this._onMouseUp.bind(this)),this._width=getSize(this._slideEl)[0],this._onMouseMove(t),Slider._currenSliderDrag=this,addClass(this._el,"active"),cancelEvent(t)))},Slider.prototype._onMouseUp=function(t){cur._sliderMouseUpNowEl=this._el,removeEvent(window,"mousemove",this._ev_onMouseMove),removeEvent(window,"mouseup",this._ev_onMouseUp),clearTimeout(this._debounceto),this._onValueChange(),removeClass(this._el,"active"),Slider._currenSliderDrag=!1,this._toggleHint(!1),this.options.onEndDragging&&this.options.onEndDragging(this._currValue)},Slider.prototype._onMouseMove=function(t){var i=this._getPos(),e=Math.max(t.pageX,i[0]);e=Math.min(e,i[0]+this._width),e-=i[0],this.setValue(e/this._width,!0,!0),this._onValueChangeDebounced?this._onValueChangeDebounced():this._onValueChange(),this._toggleHint(!0),this._updateHint(t,!0),cancelEvent(t)},Slider.prototype._getPos=function(){return this._slidePos=getXY(this._slideEl)},Slider.LOGFBASE=35,Slider.prototype._logf=function(t){if(!this.options.log)return t;var i=Slider.LOGFBASE;return(Math.pow(i,t)-1)/(i-1)},Slider.prototype._unlogf=function(t){function i(t,i){return Math.log(i)/Math.log(t)}if(!this.options.log)return t;var e=Slider.LOGFBASE;return i(e,1+t*(e-1))},Slider.prototype.setValue=function(t,i,e){if(!hasClass(this._el,"active")||e){var s=e?this._logf(t):t;if(this._currValue!=s){this._currValue=s;var o=e?t:this._unlogf(t);o=100*o+"%",setStyle(this._amountEl,{width:o}),setStyle(this._handlerEl,{left:o}),!i&&this._onValueChange()}}},Slider.prototype.setBackValue=function(t){toggleClass(this._backEl,"slider_back_transition",t>this._backValue),this._backValue=t;var i=100*t+"%";setStyle(this._backEl,{width:i})},Slider.prototype._onValueChange=function(){this._lastValue=this._lastValue||0,this._lastValue!=this._currValue&&(this._lastValue=this._currValue,this.options.onChange&&this.options.onChange(this._currValue))};try{stManager.done("ui_common.js")}catch(e){}